<%@ page language="java" contentType="text/html;charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="../common/commonJS.jsp" %>
<%@ include file="../common/commonLabel.jsp" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>选择机台列表</title>
</head>
<script type="text/javascript">

function doIns(){
	document.all["operate"].value = "inspage";
	document.forms[0].action = "<%=path %>/machineinfo.action";
	document.forms[0].submit();
}
function doSelinfo(cid){
	document.all["mid"].value = cid;
	document.all["operate"].value = "selpage";
	document.forms[0].submit();
}
function selectMachine(mid){
	var taskid="<%=request.getAttribute("taskid")+""%>";
	var isreset="<%=request.getAttribute("isreset")+""%>";
	document.all['mto.machineid'].value=mid;
	document.all['mto.taskid'].value=taskid;
	document.all['isreset'].value=isreset;
	document.all['mtid'].value="<%=request.getParameter("mtid")+""%>";
	
	document.forms[0].submit();
	if(isreset==null||isreset=='null'){
		_alert('选择成功')
	}else{
		_alert('重新选择成功');
	}
	parent.document.forms[0].submit();
	doclose();
}
</script>
<body>
<form action="<%=path %>/MachinetaskorderIns.action" method="post" >
<table width="90%" border="0" cellpadding="0" cellspacing="0" >
  <tr>
     <td>
     <table width="100%" height="100%" border="0" cellspacing="0" cellpadding="0" class="MainBody">
		<tr>
    		<td width="760" class="MainBody_title">选择一个机台</td>
    		<td></td>
		</tr>
      <tr>
        <td valign="top" colspan="2">
        <table border="0" cellspacing="0" cellpadding="0" style="margin-top: 10px;margin-bottom: 10px;width:90%">
			<tr>
				<td align="right" >
				<%--**************隐藏域信息************************--%>
				<input name="mid" type="hidden" value=""/>
				<input name="mto.machineid" type="hidden" value=""/>
				<input name="mto.taskid" type="hidden" value=""/>
				<input name="isreset" type="hidden" value=""/>
				<input name="mtid" type="hidden" value=""/>
				<%--*****************************************************--%>
				</td>
				<td align="right" ><input type="button" value="添 加" class="btn" onclick="doIns()"/>&nbsp;&nbsp;&nbsp;&nbsp;
				</td>
			</tr>
		</table>
        <table border="0" cellpadding="0" cellspacing="0"  class="MainBody_table">
           <tr>
				<th width="8%" nowrap="nowrap">机台编号</th>
				<th width="15%" nowrap="nowrap">机台名称</th>
				<th width="15%" nowrap="nowrap">厂商</th>
				<th width="10%" nowrap="nowrap">类型</th>
				<th width="10%" nowrap="nowrap">规格</th>
				<th width="8%" nowrap="nowrap">负责人</th>
				<th width="8%" nowrap="nowrap">所属车间</th>
				<th width="7%" nowrap="nowrap">操作</th>
			</tr>
			
			<c:forEach items="${list}" varStatus="status" var="rows">
			<tr>
				<td nowrap="nowrap">${rows.machineid}</td>
				<td nowrap="nowrap"><a href="#" title="机台详细信息" onclick="doSelinfo('${rows.id}')">${rows.machinename}</a></td>
				<td nowrap="nowrap">${rows.manufacturer}</td>
				<td nowrap="nowrap">${rows.machinetype}</td>
				<td nowrap="nowrap">${rows.standard}</td>
				<td nowrap="nowrap">${rows.operater}</td>
				<td nowrap="nowrap">${rows.workshop}</td>
				<td nowrap="nowrap">
				<span class='RoleSpan' onclick="selectMachine('${rows.machineid}')" title='选择机台' style='color: green;' onmouseout="doMsOut('green')" onmouseover='doMsOver()'>选择</span>
				</td> 
			</tr>
			</c:forEach>
		<c:if test="${empty list}">
			<tr>
				<td colspan="8" align="center">暂时没有您可以浏览的数据</td>
			</tr>
		</c:if>
          </table>
          <c:if test="${!empty list}">
          <table border="0" cellpadding="0" cellspacing="0" class="MainBody_fun">
            <tr>
              <td>
               <hello:AllPage />
			  </td>
            </tr>
          </table>
          </c:if>
          </td>
      </tr>
    </table></td>
  </tr>
</table>
</form>
</body>
</html>